package com.rr.program._bigDecimal;

import java.math.BigDecimal;

/**
 * java的BigDecimal比较大小
 *
 * @author : RENBIAO
 * @createTime : 2021/8/31 20:48
 */
public class BigDecimalCompare {

    public static void compare(BigDecimal a,BigDecimal b){

        if(a.compareTo(b) == -1){
            System.out.println("a小于b");
        }

        if(a.compareTo(b) == 0){
            System.out.println("a等于b");
        }

        if(a.compareTo(b) == 1){
            System.out.println("a大于b");
        }

        if(a.compareTo(b) > -1){
            System.out.println("a大于等于b");
        }

        if(a.compareTo(b) < 1){
            System.out.println("a小于等于b");
        }
    }
}
